package com.csx.saas.platform.init.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.csx.basic.base.entity.Entity;
import com.csx.saas.platform.init.enumeration.InitServiceStateEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 服务
 * </p>
 *
 * @author ChenSongXin
 * @since 2021-02-28
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("saas_init_service")
@ApiModel(value = "InitService", description = "服务")
@AllArgsConstructor
public class InitService extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 服务编号
     */
    @ApiModelProperty(value = "服务编号")
    @Length(max = 20, message = "服务编号长度不能超过20")
    @TableField(value = "service_nbr", condition = LIKE)
    @Excel(name = "服务编号")
    private String serviceNbr;

    /**
     * 服务名称
     */
    @ApiModelProperty(value = "服务名称")
    @Length(max = 50, message = "服务名称长度不能超过50")
    @TableField(value = "service_name", condition = LIKE)
    @Excel(name = "服务名称")
    private String serviceName;

    /**
     * 服务Icon图
     */
    @ApiModelProperty(value = "服务Icon图")
    @Length(max = 255, message = "服务Icon图长度不能超过255")
    @TableField(value = "service_icon", condition = LIKE)
    @Excel(name = "服务Icon图")
    private String serviceIcon;

    /**
     * 服务的主图
     */
    @ApiModelProperty(value = "服务的主图")
    @Length(max = 255, message = "服务的主图长度不能超过255")
    @TableField(value = "service_logo", condition = LIKE)
    @Excel(name = "服务的主图")
    private String serviceLogo;

    /**
     * 服务原价
     */
    @ApiModelProperty(value = "服务原价")
    @TableField("service_original_price")
    @Excel(name = "服务原价")
    private BigDecimal serviceOriginalPrice;

    /**
     * 服务当前销售价
     */
    @ApiModelProperty(value = "服务当前销售价")
    @TableField("service_price")
    @Excel(name = "服务当前销售价")
    private BigDecimal servicePrice;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注")
    private String remark;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    @Length(max = 65535, message = "描述长度不能超过65535")
    @TableField("describe_")
    @Excel(name = "描述")
    private String describe;

    /**
     * 状态\n#{ENABLE:启用;DISABLE:禁用;}
     */
    @ApiModelProperty(value = "状态\n#{ENABLE:启用;DISABLE:禁用;}")
    @TableField("state")
    @Excel(name = "状态\n#{ENABLE:启用;DISABLE:禁用;}", replace = {"启用_ENABLE", "禁用_DISABLE",  "_null"})
    private InitServiceStateEnum state;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @TableField("sort_value")
    @Excel(name = "排序")
    private Integer sortValue;

    /**
     * 服务链接
     */
    @ApiModelProperty(value = "服务链接")
    @Length(max = 255, message = "服务链接长度不能超过255")
    @TableField(value = "link_url", condition = LIKE)
    @Excel(name = "服务链接")
    private String linkUrl;


    @Builder
    public InitService(Long id, LocalDateTime createTime, Long createdBy, LocalDateTime updateTime, Long updatedBy, 
                    String serviceNbr, String serviceName, String serviceIcon, String serviceLogo, BigDecimal serviceOriginalPrice, 
                    BigDecimal servicePrice, String remark, String describe, InitServiceStateEnum state, Integer sortValue, String linkUrl) {
        this.id = id;
        this.createTime = createTime;
        this.createdBy = createdBy;
        this.updateTime = updateTime;
        this.updatedBy = updatedBy;
        this.serviceNbr = serviceNbr;
        this.serviceName = serviceName;
        this.serviceIcon = serviceIcon;
        this.serviceLogo = serviceLogo;
        this.serviceOriginalPrice = serviceOriginalPrice;
        this.servicePrice = servicePrice;
        this.remark = remark;
        this.describe = describe;
        this.state = state;
        this.sortValue = sortValue;
        this.linkUrl = linkUrl;
    }

}
